/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Damian
 */
@Embeddable
public class LocalPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_LOCAL")
    private int idLocal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_COMPANY")
    private int idCompany;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_TYPE")
    private int idType;

    public LocalPK() {
    }

    public LocalPK(int idLocal, int idCompany, int idType) {
        this.idLocal = idLocal;
        this.idCompany = idCompany;
        this.idType = idType;
    }

    public int getIdLocal() {
        return idLocal;
    }

    public void setIdLocal(int idLocal) {
        this.idLocal = idLocal;
    }

    public int getIdCompany() {
        return idCompany;
    }

    public void setIdCompany(int idCompany) {
        this.idCompany = idCompany;
    }

    public int getIdType() {
        return idType;
    }

    public void setIdType(int idType) {
        this.idType = idType;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idLocal;
        hash += (int) idCompany;
        hash += (int) idType;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LocalPK)) {
            return false;
        }
        LocalPK other = (LocalPK) object;
        if (this.idLocal != other.idLocal) {
            return false;
        }
        if (this.idCompany != other.idCompany) {
            return false;
        }
        if (this.idType != other.idType) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.LocalPK[ idLocal=" + idLocal + ", idCompany=" + idCompany + ", idType=" + idType + " ]";
    }
    
}
